Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration script fixes #179

Merged
merged 3 commits into from
Jul 1, 2024
Merged

Migration script fixes #179

merged 3 commits into from
Jul 1, 2024

Conversation

piersy
Copy link

@piersy piersy commented Jun 26, 2024

These fixes ensure that the migration script works when there are no
ancients and also when the final celo L1 block is a pre-gingerbread block.

The migration script was assuming that ancients would be present and was
considering the numAncients-1 to be first non ancient block to migrate but when
numAncients is zero that's a problem.

Also removed logic for picking up where db migration left of for the
level db since it was complicating the logic for correctly calculating the
non ancient block to start migrating from.

Finally these changes ensure that the migration block has a non zero gas limit,
even if the parent block had a zero gas limit

@piersy piersy requested review from palango and alecps June 26, 2024 13:35
@piersy piersy marked this pull request as draft June 26, 2024 13:39
@piersy piersy force-pushed the piersy/migration-script-fixes branch from 77fc0a2 to f24dfe4 Compare June 26, 2024 14:39
@piersy piersy marked this pull request as ready for review June 26, 2024 14:45
@palango
Copy link

palango commented Jun 28, 2024

Finally these changes ensure that the migration block has a non zero gas limit,
even if the parent block had a zero gas limit

This looks fine to me, the rest I leave for @alecps .

Out of curiosity, the gas limit of zero would be problematic because it would be used in the next block as well or is there another reason?

@piersy
Copy link
Author

piersy commented Jun 28, 2024

@palango its because gas limit zero is used to determine whether a block is pre or post gingerbread and so with a gas limit of zero the trasition block wouldn't be decoded properly. It would be missing all the post gingerbread fields and all the extra fields from op-geth. I should probably add a comment to that effect.

@palango
Copy link

palango commented Jun 28, 2024

@palango its because gas limit zero is used to determine whether a block is pre or post gingerbread and so with a gas limit of zero the trasition block wouldn't be decoded properly. It would be missing all the post gingerbread fields and all the extra fields from op-geth. I should probably add a comment to that effect.

That makes sense. Yeah, please add a comment and we should also add a page to the spec mentioning all those details.

@palango
Copy link

palango commented Jun 28, 2024

Also, the base branch needs to be changed to celo7

Copy link

@alecps alecps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@piersy This looks great! Thanks for putting this together. I agree the code is much cleaner just passing in numAncients and getting rid of lastMigratedAncientBlock 👌

My only comment is that it might be helpful to keep the keepNonAncients flag bc we want to try having the rsync command run during the pre-migration (without any transformations applied). To be honest though, it's easy enough to add back so feel free to merge as is. Thanks again!

The script was assuming that ancients would have been migrated and was
considering the numAncients-1 to be the next block to migrate but when
numAncients is zero that's a problem.

Also remved logic for  picking up where db migration left of for the
level db since it was complicating the logic and that process takes a
few seconds, which is nothing compared with the minutes taken to migrate
the ancients.
@piersy piersy force-pushed the piersy/migration-script-fixes branch from f24dfe4 to 74b8139 Compare July 1, 2024 08:18
@piersy piersy changed the base branch from celo6 to celo7 July 1, 2024 08:40
@piersy
Copy link
Author

piersy commented Jul 1, 2024

@palango Added a ticket here for adding to the spec - https://github.com/celo-org/celo-blockchain-planning/issues/356

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.47%. Comparing base (9907e11) to head (6cedcfa).

Additional details and impacted files
@@             Coverage Diff             @@
##            celo7     #179       +/-   ##
===========================================
+ Coverage   61.32%   75.47%   +14.15%     
===========================================
  Files          20       16        -4     
  Lines        1753     1358      -395     
  Branches       71       12       -59     
===========================================
- Hits         1075     1025       -50     
+ Misses        646      301      -345     
  Partials       32       32               
Flag Coverage Δ
cannon-go-tests 81.03% <ø> (ø)
chain-mon-tests 27.14% <ø> (ø)
sdk-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

see 4 files with indirect coverage changes

@piersy piersy merged commit 432380f into celo7 Jul 1, 2024
46 checks passed
@piersy piersy deleted the piersy/migration-script-fixes branch July 1, 2024 09:39
karlb pushed a commit that referenced this pull request Sep 10, 2024
* Fixed migration for datadirs without ancients

The script was assuming that ancients would have been migrated and was
considering the numAncients-1 to be the next block to migrate but when
numAncients is zero that's a problem.

Also remved logic for  picking up where db migration left of for the
level db since it was complicating the logic and that process takes a
few seconds, which is nothing compared with the minutes taken to migrate
the ancients.

* Ensure that we set gas limit if migrating at pre-gingerbread point
karlb pushed a commit that referenced this pull request Sep 10, 2024
* Fixed migration for datadirs without ancients

The script was assuming that ancients would have been migrated and was
considering the numAncients-1 to be the next block to migrate but when
numAncients is zero that's a problem.

Also remved logic for  picking up where db migration left of for the
level db since it was complicating the logic and that process takes a
few seconds, which is nothing compared with the minutes taken to migrate
the ancients.

* Ensure that we set gas limit if migrating at pre-gingerbread point
karlb pushed a commit that referenced this pull request Sep 10, 2024
* Fixed migration for datadirs without ancients

The script was assuming that ancients would have been migrated and was
considering the numAncients-1 to be the next block to migrate but when
numAncients is zero that's a problem.

Also remved logic for  picking up where db migration left of for the
level db since it was complicating the logic and that process takes a
few seconds, which is nothing compared with the minutes taken to migrate
the ancients.

* Ensure that we set gas limit if migrating at pre-gingerbread point
karlb pushed a commit that referenced this pull request Sep 13, 2024
* Fixed migration for datadirs without ancients

The script was assuming that ancients would have been migrated and was
considering the numAncients-1 to be the next block to migrate but when
numAncients is zero that's a problem.

Also remved logic for  picking up where db migration left of for the
level db since it was complicating the logic and that process takes a
few seconds, which is nothing compared with the minutes taken to migrate
the ancients.

* Ensure that we set gas limit if migrating at pre-gingerbread point
karlb pushed a commit that referenced this pull request Sep 17, 2024
* Fixed migration for datadirs without ancients

The script was assuming that ancients would have been migrated and was
considering the numAncients-1 to be the next block to migrate but when
numAncients is zero that's a problem.

Also remved logic for  picking up where db migration left of for the
level db since it was complicating the logic and that process takes a
few seconds, which is nothing compared with the minutes taken to migrate
the ancients.

* Ensure that we set gas limit if migrating at pre-gingerbread point
palango pushed a commit that referenced this pull request Sep 24, 2024
* Fixed migration for datadirs without ancients

The script was assuming that ancients would have been migrated and was
considering the numAncients-1 to be the next block to migrate but when
numAncients is zero that's a problem.

Also remved logic for  picking up where db migration left of for the
level db since it was complicating the logic and that process takes a
few seconds, which is nothing compared with the minutes taken to migrate
the ancients.

* Ensure that we set gas limit if migrating at pre-gingerbread point
palango pushed a commit that referenced this pull request Sep 24, 2024
* Fixed migration for datadirs without ancients

The script was assuming that ancients would have been migrated and was
considering the numAncients-1 to be the next block to migrate but when
numAncients is zero that's a problem.

Also remved logic for  picking up where db migration left of for the
level db since it was complicating the logic and that process takes a
few seconds, which is nothing compared with the minutes taken to migrate
the ancients.

* Ensure that we set gas limit if migrating at pre-gingerbread point
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants